<!--

    Copyright (c) 2015-2017 Red Hat, Inc.
    All rights reserved. This program and the accompanying materials
    are made available under the terms of the Eclipse Public License v1.0
    which accompanies this distribution, and is available at
    http://www.eclipse.org/legal/epl-v10.html

    Contributors:
      Red Hat, Inc. - initial API and implementation

-->
<dashboard-panel panel-title="Recent Factories">

  <md-progress-linear md-mode="indeterminate"
                      ng-show="lastFactoriesController.isLoading"></md-progress-linear>

  <div class="dashboard-last-factories" ng-show="!lastFactoriesController.isLoading">
    <div class="dashboard-add-button">
      <che-button-primary che-button-title="Create Factory"
                          ng-href="#/factories/create-factory"></che-button-primary>
    </div>

    <span ng-show="lastFactoriesController.getFactories().length === 0" class="last-factories-empty-label">No factories found</span>

    <che-list ng-show="lastFactoriesController.getFactories().length > 0">
      <cdvy-factory-item layout="row"
                         ng-repeat="factory in lastFactoriesController.getFactories() | orderBy:lastFactoriesController.factoriesOrderBy | limitTo:lastFactoriesController.maxItems"
                         cdvy-factory="factory"
                         cdvy-is-selectable="false"/>
    </che-list>
  </div>
</dashboard-panel>
